﻿using Crm.CrmClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Crm.Views
{
    public partial class AdayCariCevirim : ChildWindow
    {
        CrmClient.CrmServiceClient client = new CrmClient.CrmServiceClient();
        public string Kodu { get; set; }

        public AdayCariCevirim()
        {
            InitializeComponent();
            client.AdayCariCevirCompleted += client_AdayCariCevirCompleted;
        }

        void client_AdayCariCevirCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message);
            }
            else
            {
                MessageBox.Show("işlem tamamlandı !");
                this.Close();
            }
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            client.AdayCariCevirAsync(Kodu, txtKodu.Text);
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

